/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * NuGat-API named Chameleon developed by Simon De Baets to Verimag.
 *
 */
package chameleon.view.command;

import chameleon.model.NuGatManager.NuGatManager;
import chameleon.view.input.Input;

/**
 *
 * @author simon
 */
public class ComputeStrategyCommand extends Command {
    
    String[] condParam_;
    
    public ComputeStrategyCommand(Input input, String[] condParam,
            boolean help){
        super (input,false,help);
        condParam_ = condParam;
    }

    @Override
    public Input execute() {
        if (help_){
            outputManager_.displayString(""
                    + "This command computes the strategy for the condition given on input.\n"
                    + "Syntax : compute_strategy -st -TYPE -PLAYER -TARGET\n"
                    + "or compute_strategy -lt -PLAYER -formula\n"
                    + "-st : smv target\n"
                    + "-lt : ltl target (with use smsv representation)\n"
                    + "TYPE : REACHTARGET, REACHDEADLOCK, AVOIDTARGET, AVOIDEADLOCK\n"
                    + "PLAYER : P1, P2\n"
                    + "TARGET : formula (String) that represent set of states\n"
                    + "formula : LTL formula that represent condition\n");
        }
        else{
            
            InternalCheckCommand check = new InternalCheckCommand(input_, 2);
            if (check.isOk()){
                NuGatManager manager = (NuGatManager) input_.getManager();
                manager.computeStrategy(condParam_);
            }
        }
        return input_;
    }
}
